<?php
//私人开发环境
define('MAC_DEV', in_array($_SERVER['SERVER_ADDR'], array('127.0.0.1')));

//VPS环境
define('VPS_ENV', in_array($_SERVER['SERVER_ADDR'], array('45.32.29.179')));

define('STORAGE_TEST', false);
define('REWRITE', true);

$commonConfig = array(
    'app_id' => 'videohehe',
    'storage' => array(
        '_clusters' => array('http://imageservice.dwstatic.com/api_storage.php'), //新的
        '_try_connect_max' => 5, // 链接重试次数
        '_tmp_dir' => '/tmp', // 临时目录
        '_group_name' => 'vhuya',// 默认组名
        '_remote_url'  => 'http://s1.dwstatic.com',// 远程配置
    ),
    'rewrite' => array(
		/*'http://'.$_SERVER['HTTP_HOST'].'/grab/tasklist/<p>/<status>' => 'grab/tasklist',
		'http://'.$_SERVER['HTTP_HOST'].'/admin/tasklist/<p>/<status>/<tplMode>' => 'admin/tasklist',
        'http://'.$_SERVER['HTTP_HOST'].'/<c>/<a>' => '<c>/<a>',*/
		'grab/tasklist/<p>/<status>' => 'grab/tasklist',
		'admin/tasklist/<p>/<status>/<tplMode>' => 'admin/tasklist',
		'<c>/<a>' => '<c>/<a>',
    ),
);


if (MAC_DEV) { //私人开发环境
	define('DEBUG', true);
	define('DWAE_MMC_HOST_1', '127.0.0.1');
	define('DWAE_MMC_PORT_1', 11212);
	define('DWAE_MMC_HOST_2', '127.0.0.1');
	define('DWAE_MMC_PORT_2', 11212);

	return array_merge($commonConfig, array(
		'mysql' => array(
			'MYSQL_HOST' => '127.0.0.1',
			'MYSQL_PORT' => '3306',
			'MYSQL_USER' => 'videohehe',
			'MYSQL_DB' => 'videohehe',
			'MYSQL_PASS' => '7d1a805982405a015c5c4c42b2e9722330c10057',
			'MYSQL_CHARSET' => 'utf8',
		),
		'redis'=>array(
			'host'=>'127.0.0.1',
			'port'=>'6379',
		),
	    'api' => array(
            // 'xxx' => ...
        ),
	));
} elseif (VPS_ENV){  //外网VPS环境
	define('DEBUG', true);
	define('DWAE_MMC_HOST_1', '127.0.0.1');
	define('DWAE_MMC_PORT_1', 11212);
	define('DWAE_MMC_HOST_2', '127.0.0.1');
	define('DWAE_MMC_PORT_2', 11212);

	return array_merge($commonConfig, array(
		'mysql' => array(
			'MYSQL_HOST' => '127.0.0.1',
			'MYSQL_PORT' => '3306',
			'MYSQL_USER' => 'videohehe',
			'MYSQL_DB' => 'videohehe',
			'MYSQL_PASS' => '7d1a805982405a015c5c4c42b2e9722330c10057',
			'MYSQL_CHARSET' => 'utf8',
		),
		'redis'=>array(
			'host'=>'127.0.0.1',
			'port'=>'6379',
		),	
	    'api' => array(
            // 'xxx' => ...
        ),
	));	
}